Skip to content

refactor: Improve and document Testplan.get_stage_regressions#232

Open
rswarbrick wants to merge 1 commit into
lowRISC:masterfrom
rswarbrick:get-stage-regressions
Open

refactor: Improve and document Testplan.get_stage_regressions#232
rswarbrick wants to merge 1 commit into
lowRISC:masterfrom
rswarbrick:get-stage-regressions

Conversation

@rswarbrick
Copy link
Copy Markdown
Contributor

(I was inspired by doing some simple bug fixes, so I picked the next undocumented function in the file...)

This was prompted by trying to understand the function in order to document what it did. Changes to the code:

  • Sort the tests associated with a stage instead of using the default ordering that was presumably based on the way the set of tests got built up from testpoints.

  • Explicitly use Testpoint.stages for the class variable instead of tp.stages: I wasted five minutes trying to figure out what was going on here.

  • Avoid the "ms" name (the thing that is now called a development stage was called a milestone in OpenTitan until 2022: see d1aeac6).

  • Use setdefault instead of a defaultdict

  • Iterate over items rather than iterating over keys and doing a lookup each time.

This was prompted by trying to understand the function in order to
document what it did. Changes to the code:

 - Sort the tests associated with a stage instead of using the default
   ordering that was presumably based on the way the set of tests got
   built up from testpoints.

 - Explicitly use Testpoint.stages for the class variable instead of
   tp.stages: I wasted five minutes trying to figure out what was
   going on here.

 - Avoid the "ms" name (the thing that is now called a development
   stage was called a milestone in OpenTitan until 2022: see d1aeac6).

 - Use setdefault instead of a defaultdict

 - Iterate over items rather than iterating over keys and doing a
   lookup each time.

Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
@rswarbrick rswarbrick requested a review from machshev June 4, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant